package org.ytor.core.sqlflow.builder.select;

import org.ytor.core.sqlflow.SFunction;

/**
 * created by yangtong on 2025/8/11 10:06:45
 * <br/>
 * SELECT 阶段：只负责选择字段与进入 FROM
 */
public interface SelectStage extends ISelect {

    /**
     * 指定查询字段
     */
    <A> SelectStage select(SFunction<A, ?> field1);

    /**
     * 指定查询字段
     */
    <A, B> SelectStage select(SFunction<A, ?> field1, SFunction<B, ?> field2);

    /**
     * 指定查询字段
     */
    <A, B, C> SelectStage select(SFunction<A, ?> field1, SFunction<B, ?> field2, SFunction<C, ?> field3);

    /**
     * 指定查询字段
     */
    <A, B, C, D> SelectStage select(SFunction<A, ?> field1, SFunction<B, ?> field2, SFunction<C, ?> field3, SFunction<D, ?> field4);

    /**
     * 指定查询字段
     */
    <A, B, C, D, E> SelectStage select(SFunction<A, ?> field1, SFunction<B, ?> field2, SFunction<C, ?> field3, SFunction<D, ?> field4,  SFunction<E, ?> field5);

    /**
     * 指定查询字段
     */
    <A, B, C, D, E, F> SelectStage select(SFunction<A, ?> field1, SFunction<B, ?> field2, SFunction<C, ?> field3, SFunction<D, ?> field4,  SFunction<E, ?> field5,  SFunction<F, ?> field6);

    /**
     * 指定查询字段
     */
    <A, B, C, D, E, F, G> SelectStage select(SFunction<A, ?> field1, SFunction<B, ?> field2, SFunction<C, ?> field3, SFunction<D, ?> field4,  SFunction<E, ?> field5,  SFunction<F, ?> field6, SFunction<G, ?> field7);

    /**
     * 指定查询字段
     */
    //<T> SelectStage select(SFunction<T, ?>... fields);

    /**
     * 指定查询字段（原生片段）
     */
    SelectStage selectRaw(String... raw);

    /**
     * from 子句, 自动推断别名
     */
    FromStage from(Class<?> clazz);

    /**
     * from 子句, 手动指定别名
     */
    FromStage from(Class<?> clazz, String alias);

    FromStage from(String table, String alias);

    /**
     * from 子查询
     */
    FromStage from(SelectBuilder subSelect, String alias);
}
